<h1>Listing users</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Login</th>
    <th>Password</th>
    <th>Type</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @users.each do |user| %>
  <tr>
    <td><%= user.name %></td>
    <td><%= user.login %></td>
    <td><%= user.password %></td>
    <td><%= user.type.downcase + "s" %></td>
    <td><%= link_to 'Show', :controller => user.type.downcase + "s", :action => "show", :id => user.id %></td>
    <td><%= link_to 'Edit',:controller => user.type.downcase + "s", :action => "edit", :id => user.id  %></td>
    <td><%= link_to 'Destroy', :controller => user.type.downcase + "s", :action => "destroy", :id => user.id %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New User', new_user_path %>
